libxl: idl: Provide struct and union tags
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 12 Dec 2011 17:48:39 +0000 (17:48 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 12 Dec 2011 17:48:39 +0000 (17:48 +0000)
Instead of generating:

   typedef struct {
     ...
   } libxl_foo;

Produce:

   typedef struct libxl_foo {
     ...
   } libxl_foo;

This makes it possible to refer to libxl idl-generated structs and
unions, as incomplete types, before they have been defined.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/gentypes.py

index d8f43e3173d79bd525cda01ff9b3b035dd0ab5c6..7ca63755ac745074621f8a4f0710550b86fad549 100644 (file)
@@ -56,7 +56,7 @@ def libxl_C_type_define(ty, indent = ""):
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
-            s += "typedef %s {\n" % ty.kind
+            s += "typedef %s %s {\n" % (ty.kind, ty.typename)
 
         for f in ty.fields:
             if f.comment is not None: